<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="ProjectConfigSchema"
		targetNamespace="http://www.cycle99.com/tools/ecmadoc"
		elementFormDefault="qualified"
		xmlns="http://www.cycle99.com/tools/ecmadoc"
		xmlns:c="http://www.cycle99.com/tools/ecmadoc"
		xmlns:xs="http://www.w3.org/2001/XMLSchema">
		
	<xs:include schemaLocation="Parser.xsd"/>
		
	<xs:element name="project" type="c:ProjectConfig">
	</xs:element>
	
	<xs:complexType name="ProjectConfig">
		<xs:sequence>
			<xs:element name="output" type="c:ProjectOutput" minOccurs="1" maxOccurs="1"/>
			<xs:element name="sources" minOccurs="1" maxOccurs="1">
				<xs:complexType>
					<xs:choice minOccurs="0" maxOccurs="unbounded">
						<xs:element name="file">
							<xs:simpleType>
								<xs:restriction base="xs:string"/>
							</xs:simpleType>
						</xs:element>
						<xs:element name="folder" type="c:ProjectFolder"/>
					</xs:choice>
				</xs:complexType>
			</xs:element>
			<xs:element name="options" type="c:ProjectOptions" minOccurs="1" maxOccurs="1"/>
			<xs:element name="parser" type="c:ParserConfigProject" minOccurs="0" maxOccurs="1"/>
		</xs:sequence>
		<xs:attribute name="name" use="required"/>
	</xs:complexType>

	<xs:complexType name="ProjectOptions">
		<xs:attribute name="useMultipleInheritance" type="c:BooleanAttribute" use="optional" default="false"/>
		<xs:attribute name="outputMembersOnSinglePage" type="c:BooleanAttribute" use="optional" default="false"/>
		<xs:attribute name="outputDocuments" type="c:BooleanAttribute" use="optional" default="true"/>
		<xs:attribute name="documentPrivateMembers" type="c:BooleanAttribute" use="optional" default="false"/>
		<xs:attribute name="showPrivateMembers" type="c:BooleanAttribute" use="optional" default="false"/>
		<xs:anyAttribute processContents="skip"/>
	</xs:complexType>
		
	<xs:complexType name="ProjectFolder">
		<xs:annotation>
			<xs:documentation>
				Defines a folder to include when searching for files to parse. The path, if specified as relative, is considered
				relative to the location of the configuration file.
			</xs:documentation>
		</xs:annotation>
		<xs:simpleContent>
			<xs:extension base="xs:string">
				<xs:attribute name="extensions" use="optional" default="js">
					<xs:annotation>
						<xs:documentation>
							Specifies the file extensions that the files in this folder should end with in order to be added to the
							list of files to parse. Use a comma (',') or a pipe ('|') to separate the extensions 
							(e.g. 'js,html' or 'js|html', whichever you prefer). If omitted, it will default to 'js'.
						</xs:documentation>
					</xs:annotation>
					<xs:simpleType>
						<xs:restriction base="xs:string">
							<xs:pattern value="^[\w,]+$"/>
						</xs:restriction>
					</xs:simpleType>
				</xs:attribute>
				<xs:attribute name="exclude" use="optional">
					<xs:annotation>
						<xs:documentation>
							Specifies the (regular expression) patterns of file and folder names to exclude when building the list of
							files to parse. Use a space (' ') symbol to separate multiple regular expressions.
						</xs:documentation>
					</xs:annotation>
				</xs:attribute>
			</xs:extension>
		</xs:simpleContent>
	</xs:complexType>

	<xs:complexType name="ProjectOutput">
		<xs:sequence>
			<xs:element name="theme" minOccurs="1" maxOccurs="1">
				<xs:simpleType>
					<xs:restriction base="xs:string"/>
				</xs:simpleType>
			</xs:element>
		</xs:sequence>
		<xs:attribute name="path" type="xs:string" use="required"/>
		<xs:attribute name="fileExtension" type="xs:string" use="optional"/>
		<xs:attribute name="groupBy" type="c:GroupByType" use="optional" default="none"/>
	</xs:complexType>

	<xs:complexType name="ProjectReference">
		<xs:attribute name="name" use="required"/>
	</xs:complexType>

	<xs:simpleType name="GroupByType">
		<xs:restriction base="xs:string">
			<xs:enumeration value="none"/>
			<xs:enumeration value="type"/>
		</xs:restriction>
	</xs:simpleType>

	<xs:simpleType name="BooleanAttribute">
		<xs:restriction base="xs:string">
			<xs:enumeration value="true"/>
			<xs:enumeration value="false"/>
		</xs:restriction>
	</xs:simpleType>

</xs:schema>
